package com.misty.blog.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.misty.blog.bean.param.blog.*;
import com.misty.common.bean.Result;
import com.misty.dao.domain.Blog;
import org.springframework.web.bind.annotation.PathVariable;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author cthulhu
 * @since 2022-11-21
 */
public interface BlogService extends IService<Blog> {

    int saveBlog(Blog blog);

    Result<?> selectByIdWithUser(@PathVariable(name = "id") Integer id);

    Result<?> page(Integer pageNum, Integer pageSize, String search,String tag,String type);

    Result<?> order(Integer pageNum, Integer pageSize, String search);

    List<Blog> selectAllByUserId(Integer userId);

    Result<Page<Blog>> selectPageByUserId(Integer pageNum, Integer pageSize, Integer userId);

    Result<?> selectBlogAndTagByUser(BATParam param);

    Result<?> fetchSuggest(FetchSuggestParam param);

    Result<?> likeCountChange(LikeCountParam param, Integer currentUserId);

    Result<?> colCountChange(ColCountParam param, Integer currentUserId);

    Result updateBlog(SaveParam param ,HttpServletRequest request);
}
